<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Insert title here</title>

<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript">
	$(document).ready(function() {
		/* 	$("form").submit(function() {
		 var username = $(".username").val();
		 var pwd = $(".pwd").val();
		 if (username == "") {
		 alert("用戶名不能爲空");
		 return false;
		 }
		 if (pwd == "") {
		 alert("密碼不能爲空");
		 return false;
		 }
		 return true;
		 });
		 */
		$("#add").click(function() {
			var iframe = document.getElementById("iframe");
			iframe.src = (iframe.src == "page.jsp") ? '' : 'addemployee.html';
		})
		$("#update").click(function() {
			var iframe = document.getElementById("iframe");
			iframe.src = (iframe.src == "page.jsp") ? '' : 'addemployee.html';
		})
		$("#delete").click(function() {
			var iframe = document.getElementById("iframe");
			iframe.src = (iframe.src == "page.jsp") ? '' : 'addemployee.html';
		})
		$("#all").click(function() {
			var iframe = document.getElementById("iframe");
			iframe.src = (iframe.src == "page.jsp") ? '' : 'allemployee.html';
			/* $ajax({
				url:"GetAllEmployee.action",
				date:{},
				type:"post",
				datatype:"json",
				success:function(data){
					var employee = eval("("+data+")"); 
					var name = employee.name;
					var phone = employee.phone;
					var mail = employee.mail;
					var hiredate = employee.hiredate;
					var type = employee.employeeType.name;
					var code = employee.employeeLogin.code;
					var password = employee.employeeLogin.password; 
			        var str = "";
					
			        for (i=0;i<employee.length;i++) {
			            str += "<tr><td>" + employee[i].name + "</td><td>" + employee[i].phone +
			            "</td><td>" + employee[i].mail + "</td><td>" + employee[i].hiredate +
			            "</td><td>" + employee[i].employeeType.name + 
			            "</td><td>" + employee[i].employeeLogin.code + 
			            "</td><td>" + employee[i].employeeLogin.password +
			            "</td></tr>";
			        }
			        $("addDiv").append(str);
				}
			}) */
		})
	})
</script>

</head>
<body>

	<div align="center" style="height: 120px; width: auto; float: none;">
		<h1>轻课网在线考试系统</h1>
	</div>
	<div style="height: 200px; width: 450px; float: left;">
		<ul style="margin-left: 50px;">
			<li><a id="add">添加员工</a></li>
			<li><a id="update">修改员工資料</a></li>
			<li><a id="delete">员工离职</a></li>
			<li><a id="all">查看所有员工</a></li>
		</ul>
	</div>

	<div id="addDiv">
		<iframe id="iframe" style="border: 0px; height: 500px; width: 800px;"
			src="page.jsp"> </iframe>
	</div>


</body>
</html>